<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <title>列表</title>
    <link href="__STATIC__/component/pear/css/pear.css" rel="stylesheet"/>
</head>
<body class="pear-container">

<div class="layui-card">
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"
               data-auth-add="{:check_auth('add')}"
               data-auth-edit="{:check_auth('edit')}"
               data-auth-delete="{:check_auth('del')}"
               data-auth-modify="{:check_auth('multi')}"
        ></table>
    </div>
</div>

<script src="__STATIC__/component/layui/layui.js"></script>
<script src="__STATIC__/component/pear/pear.js"></script>
<script>
    layui.use(['aphpTable'], function () {
        var aphpTable = layui.aphpTable;
        var $ = layui.$;

        var init = {
            table_elem: '#currentTable',
            table_render_id: 'currentTable',
            add_url: "{:url('add')}",
            edit_url: "{:url('edit')}",
            delete_url: "{:url('del')}",
            modify_url: "{:url('multi')}",
        };

        aphpTable.render({
            init: init,
            url: "{:url('index')}",
            toolbar: ['refresh_table', 'add', 'enable', 'disable', 'delete'],
            search: true,
            quickSearch: 'title|sign@like#搜索',
            cols: [[
                { type: 'checkbox'},
                { title: '排序', field: 'sort', search: false, edit: 'text'},
                { title: 'ID', field: 'id' },
                { title: '类型', field: 'type_id', templet: aphpTable.formatter.label, selectList: { 1: '用户', 2: '系统'} },
                { title: '标识', field: 'sign' },
                { title: '标题', field: 'title' },
                { title: '备注', field: 'memo' },
                { title: '更新时间', field: 'update_time' ,templet: aphpTable.formatter.datetime, search: 'range' },
                { title: '状态', field: 'status', align: 'center', unresize: true, templet: aphpTable.formatter.switch },
                { title: '操作', align: 'center', width: 120, templet: aphpTable.formatter.tool, operat: ['edit','delete']}
            ]],
            page: {}
        });
        aphpTable.bindEvent();
    });
</script>
</body>
</html>